<template>
  <el-input
    v-model="text"
    prefix-icon="el-icon-search"
    placeholder="请输入商品名称"
    @keyup.enter.native="select"
    @blur="select2"
  ></el-input>
</template>

<script>
export default {
  data() {
    return {
      text: "",
    };
  },
  props: ["SelectOne","SelectTwo"],
  computed:{
      getText(){
          return this.text.trim()
      }
  },
  methods: {
    select() {
      //查询内容
      //1.查询内容不能为空
      //2.查询完毕后清空
      this.SelectOne(this.getText);
      this.text='';
    },
    select2(){
     this.$emit("SelectTwo",this.getText);
     this.text='';
    }
  },
};
</script>
